package com.insurance.controller;

import com.insurance.model.Course;
import com.insurance.model.Score;
import com.insurance.model.Student;
import com.insurance.model.ThbAccount;
import com.insurance.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 27340 on 2018/1/7.
 */
@RequestMapping("/demo")
@Controller
public class DemoController {
    @Autowired
    TestService testService;

    @RequestMapping("profile/test")
    public String test(){
        return "hello";
    }

    @RequestMapping(path = "/queryDemo", method = RequestMethod.GET)
    @ResponseBody
    public Score queryDemo(){
        return testService.queryScore(1);
    }

    @RequestMapping(path = "/queryDemo1", method = RequestMethod.GET)
    @ResponseBody
    public Score queryDemo1(){
        return testService.queryScore1(1);
    }

    @RequestMapping(path = "/queryDemo2", method = RequestMethod.GET)
    @ResponseBody
    public Course queryDemo2(){
        return testService.queryCourse(1);
    }

    @RequestMapping(path = "/queryDemo3", method = RequestMethod.GET)
    @ResponseBody
    public Student queryDemo3(){
        return testService.queryStudent(1);
    }

    @RequestMapping(path = "/queryDemo4", method = RequestMethod.GET)
    @ResponseBody
    public ThbAccount queryDemo4(){
        return testService.queryThbAccount(1);
    }

}
